package com.google.srclib.dataset;

import java.sql.SQLException;
import java.sql.Types;

import com.google.srclib.base.IDable;
import com.google.srclib.base.Versionable;

/**
 * 
 * @author Yuyao Liang
 * 
 */
public class StockRecordDataset extends RecordDataSet implements IDable,
		Versionable {

	public static final int DATE = 1;
	public static final int OPEN = 2;
	public static final int HIGH = 3;
	public static final int LOW = 4;
	public static final int CLOSE = 5;
	public static final int VOLUMN = 6;
	public static final int ADJCLOSE = 7;
	public static final int STOPPRICE = 8;

	public final String Version = Messages
			.getString("StockRecordDataset.VERSION"); //$NON-NLS-1$

	public StockRecordDataset() throws SQLException {
		super();
		addColumn(
				Messages.getString("StockRecordDataset.DATE"), Types.VARCHAR, 16, 0); //$NON-NLS-1$
		addColumn(
				Messages.getString("StockRecordDataset.OPEN"), Types.DOUBLE, 16, 0); //$NON-NLS-1$
		addColumn(
				Messages.getString("StockRecordDataset.HIGH"), Types.DOUBLE, 16, 0); //$NON-NLS-1$
		addColumn(
				Messages.getString("StockRecordDataset.LOW"), Types.DOUBLE, 16, 0); //$NON-NLS-1$
		addColumn(
				Messages.getString("StockRecordDataset.CLOSE"), Types.DOUBLE, 16, 0); //$NON-NLS-1$
		addColumn(
				Messages.getString("StockRecordDataset.VOLUMN"), Types.DOUBLE, 16, 0); //$NON-NLS-1$
		addColumn(
				Messages.getString("StockRecordDataset.ADJCLOSE"), Types.DOUBLE, 16, 0); //$NON-NLS-1$
		addColumn(
				Messages.getString("StockRecordDataset.STOPPRICE"), Types.DOUBLE, 16, 0); //$NON-NLS-1$
	}

	public StockRecordDataset(String name) throws SQLException {
		this();
		this.name = name;
	}

	public StockRecordDataset(SimpleResultSet rs) throws SQLException {
		super(rs);
	}

	@Override
	public String getVersion() {
		return Version;
	}

}
